import os
import __builtin__
import locale

from gmangas import curdir

import pygtk
pygtk.require('2.0')
from gtk import glade

GETTEXT_DOMAIN = "gmangas"
LOCALE_PATH = os.path.join(curdir, "i18n")
LOCALE = 'en'#locale.getdefaultlocale()[0]
os.environ.setdefault('LANG', LOCALE)

if LOCALE.find('en') == -1:
    try:
        import gettext
        for module in glade, gettext:
            module.bindtextdomain(GETTEXT_DOMAIN, LOCALE_PATH)
            module.textdomain(GETTEXT_DOMAIN)
        _ = gettext.gettext
    except:
        _ = lambda x: x
else: _ = lambda x: x

__builtin__._ = _
